<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<!-- Set render engine for 360 browser -->
	<meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->

	<link href="/public/simpleboot/themes/<?php echo C('SP_ADMIN_STYLE');?>/theme.min.css" rel="stylesheet">
    <link href="/public/simpleboot/css/simplebootadmin.css" rel="stylesheet">
    <link href="/public/js/artDialog/skins/default.css" rel="stylesheet" />
    <link href="/public/simpleboot/font-awesome/4.7.0/css/font-awesome.min.css"  rel="stylesheet" type="text/css">
    <style>
		.length_3{width: 180px;}
		form .input-order{margin-bottom: 0px;padding:3px;width:40px;}
		.table-actions{margin-top: 5px; margin-bottom: 5px;padding:0px;}
		.table-list{margin-bottom: 0px;}
	</style>
	<!--[if IE 7]>
	<link rel="stylesheet" href="/public/simpleboot/font-awesome/4.4.0/css/font-awesome-ie7.min.css">
	<![endif]-->
<script type="text/javascript">
//全局变量
var GV = {
    DIMAUB: "/",
    JS_ROOT: "public/js/",
    TOKEN: ""
};
</script>
<!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="/public/js/jquery.js"></script>
    <script src="/public/js/wind.js"></script>
    <script src="/public/simpleboot/bootstrap/js/bootstrap.min.js"></script>
<?php if(APP_DEBUG): ?><style>
		#think_page_trace_open{
			z-index:9999;
		}
	</style><?php endif; ?>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="<?php echo U('Promoters/index');?>">列表</a></li>
			<li><a href="<?php echo U('Promoters/add');?>">添加</a></li>
		</ul>
        <form class="well form-search" method="post" action="<?php echo U('Promoters/index');?>">
            <?php if($isshow): ?>代理商： 
			<select class="select_2" name="one_id">
				<option value="">全部</option>
				<?php if(is_array($proxys)): $i = 0; $__LIST__ = $proxys;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v['id']); ?>" <?php if($formget["one_id"] == $v['id']): ?>selected<?php endif; ?> ><?php echo ($v['user_nicename']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
			</select> &nbsp;&nbsp;<?php endif; ?>
			推广员： 
			<input type="text" name="keyword" style="width: 200px;" value="<?php echo ($formget["keyword"]); ?>" placeholder="请输入推广员用户名、昵称...">
			<input type="submit" class="btn btn-primary" value="搜索">
		</form>	
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>用户名</th>
					<th>昵称</th>
					<th>用户总充值金额</th>
					<th>用户总消费金额</th>
					<th>主播总收益金额</th>
					<th>添加时间</th>
					<th>状态</th>
					<th width="150">操作</th>
				</tr>
			</thead>
			<tbody>
				<?php $user_statuses=array("0"=>L('已拉黑'),"1"=>'正常',"2"=>'未验证'); ?>
				<?php if(is_array($users)): foreach($users as $key=>$vo): ?><tr>
					<td><?php echo ($vo["id"]); ?></td>
					<td><?php echo ($vo["user_login"]); ?></td>
					<td><?php echo ($vo["user_nicename"]); ?></td>
					<td><?php echo ($vo["total_charge"]); ?></td>
					<td><?php echo ($vo["total_coin"]); ?></td>
					<td><?php echo ($vo["total_votes"]); ?></td>
					<td><?php echo ($vo["create_time"]); ?></td>

					<td><?php echo ($user_statuses[$vo['user_status']]); ?></td>
					<td>
							<a href='<?php echo U("Promoters/edit",array("id"=>$vo["id"]));?>'>编辑</a> | 
							<a class="js-ajax-delete" href="<?php echo U('Promoters/delete',array('id'=>$vo['id']));?>">删除</a> | 
							<?php if($vo['user_status'] == 1): ?><a href="<?php echo U('Promoters/ban',array('id'=>$vo['id']));?>" class="js-ajax-dialog-btn" data-msg="您确定要拉黑此用户吗？">拉黑</a>
							<?php else: ?>
								<a href="<?php echo U('Promoters/cancelban',array('id'=>$vo['id']));?>" class="js-ajax-dialog-btn" data-msg="您确定要启用此用户吗？">启用</a><?php endif; ?>
                            | <a href='<?php echo U("Customer/index",array("one_id"=>$vo["id"]));?>'>客户</a>
					</td>
				</tr><?php endforeach; endif; ?>
			</tbody>
		</table>
		<div class="pagination"><?php echo ($page); ?></div>
	</div>
	<script src="/public/js/common.js"></script>
</body>
</html>